# coding=utf-8
import datetime
import itchat
import random
from collections import deque
import time
import re
itchat.auto_login()
# hotReload=True
history = deque([], 100)  # 这个是百人队列，支持先后顺序的，很厉害
author = ''
author1 = ''


# 查找备注名,
def searchvip_name(vipname):
    itchat.get_friends(update=True)#现更新号上的字典，然后下一步查找想要发送的人
    author = itchat.search_friends(name=vipname)[0]   #获取备注、微信号、昵称中的任何一项等于name键值的用户
    print()

@itchat.msg_register(itchat.content.TEXT)
def text_reply(msg):
    print(msg.fromUserName)
    msg.user.send('%s: %s' % (msg.type, msg.text))



itchat.run()
# itchat.logout()